(function(){
    function w() {
        var r = document.documentElement;
        var a = r.getBoundingClientRect().width;
            if (a > 1080 ){
                a = 1080;
            } 
            rem = a / 1080 * 300;
            r.style.fontSize = rem + "px"
    }
    var t;
    w();
    window.addEventListener("resize", function() {
        clearTimeout(t);
        t = setTimeout(w, 300)
    }, false);
})();

